<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
	</head>

	<body>
		<form class="mui-input-group">
			<div class="mui-input-row">
				<label>开始时间</label>
				<input type="date" id="beginTime" name="beginTime" class="mui-input-clear">
			</div>
			<div class="mui-input-row">
				<label>结束时间</label>
				<input type="date" id="endTime" name="endTime" class="mui-input-clear">
			</div>
			<div class="mui-button-row">
				<button type="button" class="mui-btn mui-btn-primary" onclick="loadlist()">查询</button>
			</div>
		</form>
		<ul class="mui-table-view">

		</ul>
		<script src="js/mui.min.js"></script>
		<script src="js/mui.meeting.js"></script>

		<script type="text/javascript">
			var users;

			mui.init()
			mui.plusReady(function() {
				//当前登录用户
				users = JSON.parse(localStorage.getItem('$users') || '[]');
			})

			//加载列表
			function loadlist() {
				meeting.Get(meeting.Url.getDefaultSiteUrl("order/find_timeanduserid"), {
					data: {
						userid: users.onlyC,
						begin_time: document.getElementById("beginTime").value,
						end_time: document.getElementById("endTime").value
					},
					success: function(data, status, xhr) {
						if (data.state > 0) {
							document.querySelector(".mui-table-view").innerHTML = "";
							for (var i = 0; i < data.data.length; i++) {
								loaditem(data.data[i]);
							}
						} else {
							mui.toast(data.message);
						}
					}
				})
			}

			function loaditem(order) {
				console.log(JSON.stringify(order))
				var li = document.createElement("li");
				li.className = "mui-table-view-cell";
				li.setAttribute("onlyC", order.onlyC);
				li.innerHTML =
					'<div class="mui-slider-handle">' +
					order.onlyc + "|" + order.gxid + "|" + order.num + "|" + order.createdate + '</div>';
				document.querySelector(".mui-table-view").appendChild(li);
			}
		</script>
	</body>

</html>
